/**
 * Copyright:Copyright(c)2014-2017
 * Company:厦门市易致达物联网科技有限公司
 * @version 1.0
 */
package shop.services.manage.balance.dao.impl;

import java.util.List;

import shop.core.common.dao.BaseDao;
import shop.core.common.dao.page.PagerModel;
import shop.services.manage.balance.bean.Balance;
import shop.services.manage.balance.dao.BalanceDao;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @类名称：BalanceDaoImpl
 * @创建人：wzl
 * @创建时间：2018-01-03 下午16:30:00  
 * @版本号：1.0
 * @描述：
 */
@Repository("balanceDaoManage")
public class BalanceDaoImpl  implements BalanceDao {

    @Resource
    private BaseDao dao;

    public void setDao(BaseDao dao) {
        this.dao = dao;
    }

    public PagerModel selectPageList(Balance e) {
        return dao.selectPageList("manage.balance.selectPageList","manage.balance.selectPageCount", e);
    }

    public List selectList(Balance e) {
        return dao.selectList("manage.balance.selectList", e);
    }

    public Balance selectOne(Balance e) {
        return (Balance) dao.selectOne("manage.balance.selectOne", e);
    }

    public int delete(Balance e) {
        return dao.delete("manage.balance.delete", e);
    }

    public int update(Balance e) {
        return dao.update("manage.balance.update", e);
    }

    public int deletes(String[] ids) {
        Balance e = new Balance();
        for (int i = 0; i < ids.length; i++) {
            e.setId(ids[i]);
            delete(e);
        }
        return 0;
    }

    public int insert(Balance e) {
        return dao.insert("manage.balance.insert", e);
    }

    public int deleteById(int id) {
        return dao.delete("manage.balance.deleteById", id);
    }

    @Override
    public Balance selectById(String id) {
        return (Balance) dao.selectOne("manage.balance.selectById", id);
    }

    @Override
    public PagerModel selectBalancePage(Balance balance) {
        return dao.selectPageList("manage.balance.selectBalancePage","manage.balance.selectBalancePageCount", balance);
    }
}

